package demo;

import demo.student.impl.WangGang;
import demo.student.impl.XiaoMing;
import demo.student.impl.ZhuangZhuang;
import demo.teacher.AbstractTeacher;
import demo.teacher.impl.Teacher;

/**
 * 观察者模式
 * 定义对象间的一种一对多依赖关系，
 * 使得每当一个对象状态发生改变时，
 * 其相关依赖对象皆得到通知并被自动更新。
 * @author ZhouWeiBo
 * @create 2022/6/7
 */
public class App {
    public static void main(String[] args) {
        AbstractTeacher wangLaoShi = new Teacher();
        wangLaoShi.addStudent(new WangGang());
        wangLaoShi.addStudent(new XiaoMing());
        wangLaoShi.addStudent(new ZhuangZhuang());
        wangLaoShi.classBegin();
    }
}
